<script setup lang="ts">
import KnowledgeList from './components/KnowledgeList.vue'
import FollowBigShot from './components/FollowBigShot.vue'
const active = ref(0);
</script>

<template>
  <div class="home-page">
    <!-- 头部 -->
    <div class="home-header">
      <div class="con">
        <h1>嗯嗯健康  健康嗯嗯</h1>
        <div class="search">
          <pk-icon name="home-search" /> 热门话题:你们嗯嗯的时候玩手机吗?
        </div>
      </div>
    </div>
    <!-- 导航 -->
    <div class="home-navs">
      <van-row>
        <van-col span="8">
          <router-link to="/" class="nav">
            <pk-icon name="home-doctor"></pk-icon>
            <p class="title">问嗯友</p>
            <p class="desc">按症状问嗯友</p>
          </router-link>
        </van-col>
        <van-col span="8">
          <router-link to="/consult/fast" class="nav">
            <pk-icon name="home-graphic"></pk-icon>
            <p class="title">紧急问嗯</p>
            <p class="desc">20s嗯嗯专家速回</p>
          </router-link>
        </van-col>
        <van-col span="8">
          <router-link to="/" class="nav">
            <pk-icon name="home-prescribe"></pk-icon>
            <p class="title">止嗯神药</p>
            <p class="desc">线上买药更好嗯</p>
          </router-link>
        </van-col>
      </van-row>
      <van-row>
        <van-col span="6">
          <router-link to="/" class="nav min">
            <pk-icon name="home-order"></pk-icon>
            <p class="title">药品订单</p>
          </router-link>
        </van-col>
        <van-col span="6">
          <router-link to="/" class="nav min">
            <pk-icon name="home-docs"></pk-icon>
            <p class="title">嗯嗯档案</p>
          </router-link>
        </van-col>
        <van-col span="6">
          <router-link to="/" class="nav min">
            <pk-icon name="home-rp"></pk-icon>
            <p class="title">我的嗯方</p>
          </router-link>
        </van-col>
        <van-col span="6">
          <router-link to="/" class="nav min">
            <pk-icon name="home-find"></pk-icon>
            <p class="title">非嗯咨询</p>
          </router-link>
        </van-col>
      </van-row>
    </div>
    <!-- 轮播图 -->
    <div class="home-banner">
      <van-swipe indicator-color="#fff">
        <van-swipe-item>
          <img src="@/assets/ad.png" alt="" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/ad.png" alt="" />
        </van-swipe-item>
      </van-swipe>
    </div>
    <!-- tab -->
    <!-- 
    1.  2. 3. 4.
    -->
    <van-tabs shrink sticky v-model:active="active">
      <van-tab title="关注">
        <follow-big-shot></follow-big-shot>
        <knowledge-list type="like" />
      </van-tab>
      <van-tab title="推荐">
        <knowledge-list type="recommend" />
      </van-tab>
      <van-tab title="很容易">
        <knowledge-list type="easy" />
      </van-tab>
      <van-tab title="很困难">
        <knowledge-list type="hard" />
      </van-tab>
    </van-tabs>
  </div>
</template>

<style lang="scss" scoped>
.home-page {
  padding-bottom: 50px;
}
.home-header {
  height: 100px;
  position: relative;
  &::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 110px;
    background: linear-gradient(180deg, rgba(247, 123, 7, 0.85), #ffc20e);
    border-bottom-left-radius: 200px 20px;
    border-bottom-right-radius: 200px 20px;
  }
  .con {
    position: relative;
    padding: 0 15px;
    > h1 {
      font-size: 18px;
      color: #fff;
      font-weight: normal;
      padding: 20px 0;
      line-height: 1;
      padding-left: 5px;
    }
    .search {
      height: 40px;
      border-radius: 20px;
      box-shadow: 0px 15px 22px -7px rgba(224, 236, 250, 0.8);
      background-color: #fff;
      display: flex;
      align-items: center;
      padding: 0 20px;
      color: var(--pk-dark);
      font-size: 13px;
      .pk-icon {
        font-size: 16px;
        margin-right: 5px;
      }
    }
  }
}
.home-navs {
  padding: 10px 15px 0 15px;
  .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    .pk-icon {
      font-size: 48px;
    }
    .title {
      font-weight: 500;
      margin-top: 5px;
      color: var(--pk-text1);
    }
    .desc {
      font-size: 11px;
      color: var(--pk-tag);
      margin-top: 2px;
    }
    &.min {
      .pk-icon {
        font-size: 31px;
      }
      .title {
        font-size: 13px;
        color: var(--pk-text2);
        font-weight: normal;
      }
    }
  }
}
.home-banner {
  padding: 10px 15px;
  height: 100px;
  img {
    width: 100%;
    // height:s 100%;
  }
  .van-swipe {
    width: 100%;
    height: 100%;
  }
}
</style>